package hfjava;

import java.util.Scanner;

public class Demo_6 {
    public static void main(String[] args) {
        double[] moneys=new double[5];
        Scanner input=new Scanner(System.in);
        System.out.println("请输入本月消费记录");
        double sum=0;
        for (int i = 0; i <moneys.length ; i++) {
            System.out.println("请输入第"+(i+1)+"笔购物金额:");
            moneys[i]=input.nextDouble();
            sum+=moneys[i];
        }
        System.out.println("序号"+"\t\t"+"金额（元）");
        for (int i = 0; i <moneys.length ; i++) {
            System.out.println((i+1)+"\t\t\t"+moneys[i]);
        }
        System.out.println("总金额"+"\t\t"+sum);
    }
}
